﻿function same_height() {
    var left = document.getElementById('leftsidebar');
    var center = document.getElementById('content');
    var right = document.getElementById('rightsidebar');

    if (center.offsetHeight <= 700)
        return;
    left.style.height = (center.offsetHeight - 20) + 'px';
    right.style.height = (center.offsetHeight - 20) + 'px';
}

function show_category(categories, message) {
	var category = document.getElementById(categories).value;
	var root = document.getElementById('register_form');
	root.style.display = 'block';
	for (var i = 0; i < root.childNodes.length; i++) {
	    if (root.childNodes[i].nodeName == 'UL') {
	        root.childNodes[i].style.display = 'none';
	        if (root.childNodes[i].id == category) {
	            root.childNodes[i].style.display = 'block';
	        }
	    }
	}
	document.getElementById(message).innerHTML = category;
}

function hide(item) {
	var element = document.getElementById(item);

	if(element.style.display != "none")
	{
		element.style.display = "none";
		same_height();
	}
	else
	{
		element.style.display = "block";
		same_height();
	}
}
